/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package db.entities;

import java.io.Serializable;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.Table;
import javax.xml.bind.annotation.XmlRootElement;

/**
 *
 * @author marcy
 */
@Entity
@Table(name = "Referenze")
@XmlRootElement
@NamedQueries({
    @NamedQuery(name = "Referenze.findById", query = "SELECT r FROM Referenze r WHERE r.id = :id"),
    @NamedQuery(name = "Referenze.findByIdPaz", query = "SELECT r FROM Referenze r WHERE r.idPaz = :idPaz"),
    })
public class Referenze implements Serializable {
    private static final long serialVersionUID = 1L;
    @Id
    @Basic(optional = false)
    @Column(name = "id")
    private Integer id;
    @Basic(optional = false)
    @Column(name = "id_paz")
    private int idPaz;
    @Column(name = "id_madre")
    private Integer idMadre;
    @Column(name = "id_padre")
    private Integer idPadre;
    @Basic(optional = false)
    @Column(name = "id_capovillaggio")
    private int idCapovillaggio;
    @Basic(optional = false)
    @Column(name = "id_medico")
    private int idMedico;
    @Basic(optional = false)
    @Column(name = "email")
    private String email;
    @Basic(optional = false)
    @Column(name = "cellulare")
    private String cellulare;

    public Referenze() {
    }

    public Referenze(Integer id) {
        this.id = id;
    }

    public Referenze(Integer id, int idPaz, int idCapovillaggio, int idMedico, String email, String cellulare) {
        this.id = id;
        this.idPaz = idPaz;
        this.idCapovillaggio = idCapovillaggio;
        this.idMedico = idMedico;
        this.email = email;
        this.cellulare = cellulare;
    }

    public Integer getId() {
        return id;
    }

    public void setId(Integer id) {
        this.id = id;
    }

    public int getIdPaz() {
        return idPaz;
    }

    public void setIdPaz(int idPaz) {
        this.idPaz = idPaz;
    }

    public Integer getIdMadre() {
        return idMadre;
    }

    public void setIdMadre(Integer idMadre) {
        this.idMadre = idMadre;
    }

    public Integer getIdPadre() {
        return idPadre;
    }

    public void setIdPadre(Integer idPadre) {
        this.idPadre = idPadre;
    }

    public int getIdCapovillaggio() {
        return idCapovillaggio;
    }

    public void setIdCapovillaggio(int idCapovillaggio) {
        this.idCapovillaggio = idCapovillaggio;
    }

    public int getIdMedico() {
        return idMedico;
    }

    public void setIdMedico(int idMedico) {
        this.idMedico = idMedico;
    }

    public String getEmail() {
        return email;
    }

    public void setEmail(String email) {
        this.email = email;
    }

    public String getCellulare() {
        return cellulare;
    }

    public void setCellulare(String cellulare) {
        this.cellulare = cellulare;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (id != null ? id.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof Referenze)) {
            return false;
        }
        Referenze other = (Referenze) object;
        if ((this.id == null && other.id != null) || (this.id != null && !this.id.equals(other.id))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "db.entities.Referenze[ id=" + id + " ]";
    }
    
}
